package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.OfComment;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface OfCommentMapper {
    int deleteByPrimaryKey(Long id);

    int insert(OfComment record);

    OfComment selectByPrimaryKey(Long id);

    List<OfComment> selectAll();

    int updateByPrimaryKey(OfComment record);

    int getOfCommentLikeNums(Long commentId);

    int getSubComms(Long commentId);

    List<OfComment> getOfCommentsListByUserId(Long commentId);

    void addOfsubComm(OfComment ofComment);

    List<OfComment> selectByStrategyCommentId(Long strategyCommentId);

    Integer selectCommentLikersCount(Long strategyCommentId);

    OfComment selectOfCommentByCommentIdAndLikerId(@Param("strategyCommentId") Long strategyCommentId,

                                                   @Param("likerId") Long likerId);

    void updateByPrimaryKeyIfCommentatorExist(@Param("ofCommentId") Long ofCommentId,
                                              @Param("likerId") Long likerId);

    Integer selectOfOfCommentLikers(@Param("ofCmmentId") Long ofCmmentId);

    Integer selectOfOfCommentNums(@Param("ofCmmentId") Long ofCmmentId);

    OfComment selectByOfCommentIdAndLikerId(@Param("strategyOfCommentId") Long strategyOfCommentId,
                                            @Param("likerId") Long likerId);

    Integer selectOfOfCommentLikersByParentId(Long strategyOfCommentId);


    Date selectTempDateByCommentId(Long parentId);

    String selectTempContentByCommentId(Long parentId);

    Integer selectOfCommentCount();
}